<?php

namespace App\Transformers\SystemNotice;

use App\Models\SystemStore;
use League\Fractal\TransformerAbstract;

class SystemStoreTransformer extends TransformerAbstract
{
    public function transform(SystemStore $data){
        return [
            'id' => $data->id,
            'name'  => $data->name ?? '',
            'introduction' => $data->introduction ?? '',
            'address' => $data->address ?? '',
            'detailed_address'  => $data->detailed_address ?? '',
            'image' => $data->image ?? '',
            'phone' => $data->phone ?? '',
            'oblong_image' => $data->oblong_image ?? '',
            'latitude'  => $data->latitude ?? '',
            'longitude' => $data->longitude ?? '',
            'valid_time' => $data->valid_time ?? '',
            'day_time' => $data->day_time ?? '',
            'is_show'  => $data->is_show ?? '',
            'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
            'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
        ];
    }

}
